﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class StrengtController : MonoBehaviour
{
    public bool IsDoubleJump = false;
    public bool IsinfiniteJump = false;
    public bool IsStrengthenShootSpeed = false;
    public bool IsDoubleHealth = false;
    public bool IsVampire = false;
    public bool IsStengthenShootDamage = false;

    public thisController playerMoveController;
    public CharacterBase playerBase;
    public AttackController playerAttack;


    private void Start()
    {
        playerMoveController = GameObject.Find("Player").GetComponent<thisController>();
        playerBase = GameObject.Find("Base").GetComponent<CharacterBase>();
        playerAttack = GameObject.Find("Attack").GetComponent<AttackController>();
    }

    private void Update()
    {
        if(IsDoubleJump)
        {
            playerMoveController.IsDoubleJump = true;
            MonsterBase.SetBuff(1.2f, 1);
            IsDoubleJump = false;
        }

        if (IsStrengthenShootSpeed)
        {
            playerAttack.shootSpeed = 8;
            MonsterBase.SetBuff(1.4f, 1.5f);
            IsStrengthenShootSpeed = false;
        }

        if (IsDoubleHealth)
        {
            playerBase.maxHealth = 10;
            playerBase.health = 10;
            MonsterBase.SetBuff(1.4f, 2);
            IsDoubleHealth = false;
        }

        if (IsVampire)
        {
            playerBase.IsVampire = true;
            MonsterBase.SetBuff(1.4f, 2.5f);
            IsVampire = false;
        }

        if (IsStengthenShootDamage)
        {
            MonsterBase.SetBuff(1.6f, 2.5f, 2);
            IsStengthenShootDamage = false;
        }

        if (IsinfiniteJump)
        {
            playerMoveController.InfiniteJump = true;
            GameObject.Find("Player").transform.position = new Vector2(0, 0);
            GameObject.Find("floor").SetActive(false);
            IsinfiniteJump = false;
        }
    }

}
